package com.ygl.gateway;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;

/**
 * @Author yanggld
 * @Date 2020/12/21-11:27
 */
public class TestTime {

    public static void main(String[] args) {
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT);
        DateTimeFormatter dateTimeFormatter1 = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT);
        DateTimeFormatter dateTimeFormatter2 = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT);
        System.out.println(dateTimeFormatter.format(LocalDate.now()));
        System.out.println(dateTimeFormatter1.format(LocalTime.now()));
        System.out.println(dateTimeFormatter2.format(LocalDateTime.now()));
    }
}
